import request from '@/utils/request'

export function find(storeReturnDTO) {
  return request({
    url: '/store/return/find',
    method: 'get',
    params: storeReturnDTO
  })
}

export function add(storeReturn) {
  return request({
    url: '/store/return/add',
    method: 'post',
    data: storeReturn
  })
}

export function update(storeReturn) {
  return request({
    url: '/store/return/update',
    method: 'put',
    data: storeReturn
  })
}

export function deleteReturns(ids) {
  return request({
    url: '/store/return/delete',
    method: 'delete',
    params: { ids }
  })
}

export function importBatch(file) {
  const formData = new FormData();
  formData.append('file', file);
  return request({
    url: '/store/return/import',
    method: 'post',
    data: formData,
    headers: {
      'Content-Type': 'multipart/form-data'
    }
  });
}
